<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php $this->registerCsrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

<div class="wrap">
    <?php
    NavBar::begin([
        'brandLabel' => Yii::$app->name,
        'brandUrl' => Yii::$app->homeUrl,
        'options' => [
            'class' => 'navbar-inverse navbar-fixed-top',
        ],
    ]);
    $menuItems = [
        ['label' => '首页', 'url' => ['/site/index']],
        ['label' => '便民工具', 'url' => ['/site/index'],'items'=>[
            [
                'label'=>'车牌归属地',
                'url'=>'/life/car'
            ],
            [
                'label'=>'手机号归属地',
                'url'=>'/life/mobile'
            ],
            [
                'label'=>'繁简转换',
                'url'=>'/char/ftz'
            ],
            [
                'label'=>'火星文转换',
                'url'=>'/char/huoxin',
            ],
            [
                'label'=>'生辰八字查询*',
                'url'=>'/life/car'
            ],
            [
                'label'=>'宝宝血型计算*',
                'url'=>'/life/car'
            ],
            [
                'label'=>'成人BMI计算',
                'url'=>'/life/bmi'
            ],
            [
                'label'=>'身材比例计算',
                'url'=>'/life/shencai'
            ],

        ]],
        ['label' => '数学工具', 'url' => ['/site/index'],'items'=>[
            [
                'label'=>'等差数列*',
                'url'=>'/life/car'
            ],
            [
                'label'=>'等比数列*',
                'url'=>'/life/car'
            ],
            [
                'label'=>'排列*',
                'url'=>'/char/pinyin'
            ],
            [
                'label'=>'组合*',
                'url'=>'/life/car'
            ],


        ]],
        ['label' => '日期时间', 'url' => ['/site/index'],'items'=>[
            [
                'label'=>'时间戳',
                'url'=>'/date/timestamp'
            ],
            [
                'label'=>'日期间隔',
                'url'=>'/date/diff'
            ],

        ]],
        ['label' => '地图', 'url' => ['/map/index'],'items'=>[
            [
                'label'=>'谷歌地图',
                'url'=>'/map/index'
            ],
            [
                'label'=>'地图坐标转换',
                'url'=>'/map/transfer'
            ],
            [
                'label'=>'台风路径',
                'url'=>'/map/taifeng'
            ],
        ]],

        ['label' => '加密', 'url' => ['/encrypt/index'],'items'=>[
            [
                'label'=>'JS异或加密',
                'url'=>'/encrypt/xor'
            ],
            [
                'label'=>'JS混淆',
                'url'=>'/encrypt/uglifyjs'
            ],
            [
                'label'=>'摩斯密码',
                'url'=>'/encrypt/morse'
            ],
        ]],
        ['label' => '字符', 'url' => ['/site/contact'],'items'=>[

            [
                'label'=>'汉字转拼音',
                'url'=>'/char/pinyin'
            ],
            [
                'label'=>'笔顺字贴',
                'url'=>'/char/bishun'
            ],
            [
                'label'=>'HTML实体',
                'url'=>'/char/html-entity'
            ],
            [
                'label'=>'特殊符号',
                'url'=>'/char/special-char'
            ],
            [
                'label'=>'正则',
                'url'=>'/regexp/index'
            ],
            ]

        ],
    ];
//    if (Yii::$app->user->isGuest) {
//        $menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
//        $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
//    } else {
//        $menuItems[] = '<li>'
//            . Html::beginForm(['/site/logout'], 'post')
//            . Html::submitButton(
//                'Logout (' . Yii::$app->user->identity->username . ')',
//                ['class' => 'btn btn-link logout']
//            )
//            . Html::endForm()
//            . '</li>';
//    }


    echo Nav::widget([
        'options' => ['class' => 'navbar-nav navbar-right'],
        'items' => $menuItems,
    ]);
    NavBar::end();
    ?>

    <div class="container">
        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        <?= Alert::widget() ?>
        <?= $content ?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; <?= Html::encode(Yii::$app->name) ?> <?= date('Y') ?>

            <a style="color:#666" target="_blank" rel="noopener" href="http://beian.miit.gov.cn/">浙ICP备17045873号-1</a>
        </p>

        <p class="pull-right"><?= Yii::powered() ?></p>
    </div>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
